local PostAction = class("PostAction")

function PostAction:ctor()
    self._actionList = {}
    self._index = 1
end

function PostAction:addAction(action)
    table.insert(self._actionList, action)
end

function PostAction:excute()
    local action = self._actionList[self._index]
    if action then
        action(self)
    end
end

function PostAction:postNext()
    self._index = self._index + 1
    self:excute()
    if self._index > #self._actionList then
        self._actionList = {}
    end
end

return PostAction
